home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / archival / ftp / holefixes / SunFTPPatch < prev    next >
Encoding:
Internet Message Format  |  1988-11-18  |  2.8 KB

  1. To: jkimball@src.honeywell.com (John Kimball)
  2. Cc: sun-nets@brillig.umd.edu
  3. Subject: My SunOS 3.5 patches for the Berkeley ftpd source
  4. Date: Thu, 17 Nov 88 12:02:20 -0800
  5. From: steve@mahendo.Jpl.Nasa.Gov
  6. Sender: Sun-Nets-request@brillig.umd.edu
  7.  
  8.  
  9. When I went to put the Berkeley ftpd code together I also ran into
  10. compiler/ linker problems.  I did a mild hack on the code and was able
  11. to get it to compile/link and run on a Sun 3/160, a 3/50 and a 3/60 all
  12. running SunOS 3.5 It was necessary to define LOG_DAEMON (openlog is
  13. differant--on 3.5 it doesn't take a third argument) uid_t (not defined
  14. anywhere--used for process ID so I defined it to be int).  Under 3.5
  15. there is no /etc/shells file and no getusershell() or endusershell()
  16. functions.  For these, I replaced the code in ftpd.c with strcmp's to
  17. "/bin/sh" and "/bin/csh" and don't allow any other shells.  Good enough
  18. for mahendo et al.  Others may need to add other shells by modifying
  19. the code.
  20.  
  21.         steve@mahendo.jpl.nasa.gov [128.149.16.2]
  22.  
  23. Context diffs suitable for patch follow:
  24.  
  25. *** Makefile.old    Wed Nov  9 14:53:39 1988
  26. --- Makefile    Wed Nov  9 10:56:49 1988
  27. ***************
  28. *** 16,22 ****
  29.   #
  30.   #    @(#)Makefile    5.8 (Berkeley) 9/22/88
  31.   #
  32. ! CFLAGS=    -O
  33.   LIBC=    /lib/libc.a
  34.   SRCS=    ftpd.c ftpcmd.c glob.c logwtmp.c popen.c vers.c
  35.   OBJS=    ftpd.o ftpcmd.o glob.o logwtmp.o popen.o vers.o
  36. --- 16,23 ----
  37.   #
  38.   #    @(#)Makefile    5.8 (Berkeley) 9/22/88
  39.   #
  40. ! CFLAGS=    -O -DLOG_DAEMON -fsoft -Duid_t=int
  41. ! # originally was CFLAGS=    -O
  42.   LIBC=    /lib/libc.a
  43.   SRCS=    ftpd.c ftpcmd.c glob.c logwtmp.c popen.c vers.c
  44.   OBJS=    ftpd.o ftpcmd.o glob.o logwtmp.o popen.o vers.o
  45. *** ftpd.c.old    Wed Nov  9 10:31:37 1988
  46. --- ftpd.c    Wed Nov  9 11:07:59 1988
  47. ***************
  48. *** 836,851 ****
  49.       struct passwd *p;
  50.       char *shell;
  51.       int found = 0;
  52. !     char line[BUFSIZ], *index(), *getusershell();
  53.   
  54.       if ((p = getpwnam(name)) == NULL)
  55.           return (0);
  56.       if ((shell = p->pw_shell) == NULL || *shell == 0)
  57.           shell = "/bin/sh";
  58. !     while ((cp = getusershell()) != NULL)
  59. !         if (strcmp(cp, shell) == 0)
  60. !             break;
  61. !     endusershell();
  62.       if (cp == NULL)
  63.           return (0);
  64.       if ((fd = fopen(FTPUSERS, "r")) == NULL)
  65. --- 836,861 ----
  66.       struct passwd *p;
  67.       char *shell;
  68.       int found = 0;
  69. !     char line[BUFSIZ], *index();
  70. ! /*    char *getusershell();            not available on SunOS 3.5
  71. !  *                        steve@mahendo.jpl.nasa.gov
  72. !  */
  73.   
  74.       if ((p = getpwnam(name)) == NULL)
  75.           return (0);
  76.       if ((shell = p->pw_shell) == NULL || *shell == 0)
  77.           shell = "/bin/sh";
  78. !     if( !strcmp( shell, "/bin/sh" ) )
  79. !         cp = "/bin/sh";
  80. !     else if( !strcmp( shell, "/bin/csh" ) )
  81. !         cp = "/bin/csh";
  82. !     else
  83. !         cp = (char *)0;
  84. ! /*    while ((cp = getusershell()) != NULL)    steve@mahendo.jpl.nasa.gov
  85. !  *        if (strcmp(cp, shell) == 0)
  86. !  *            break;
  87. !  *    endusershell();
  88. !  */
  89.       if (cp == NULL)
  90.           return (0);
  91.       if ((fd = fopen(FTPUSERS, "r")) == NULL)
  92.  
  93.